package com.kxf.androidtestdemo.view

import android.content.Context
import android.os.Build
import android.util.AttributeSet
import android.util.Log
import android.view.MotionEvent
import android.view.View
import androidx.annotation.RequiresApi

class OutSideView : View {
    constructor(context: Context?) : super(context) {}
    constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs) {}
    constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(
        context,
        attrs,
        defStyleAttr
    ) {
    }

    @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
    constructor(
        context: Context?,
        attrs: AttributeSet?,
        defStyleAttr: Int,
        defStyleRes: Int
    ) : super(context, attrs, defStyleAttr, defStyleRes) {
    }

    override fun onTouchEvent(event: MotionEvent?): Boolean {
        Log.d("OutSideView", "onTouchEvent ==>>")
        var b = super.onTouchEvent(event)
        Log.d("OutSideView", "onTouchEvent==>>b=$b")
        return b
    }

    override fun dispatchTouchEvent(event: MotionEvent?): Boolean {
        Log.d("OutSideView", "dispatchTouchEvent ==>>")
        var b = super.dispatchTouchEvent(event)
        Log.d("OutSideView", "dispatchTouchEvent==>>b=$b")
        return b
    }
}